package slicex

import (
	"math/rand"
)

type Number interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
		~float64 | ~float32
}

func RandArr[T Number](le int, max int) []T {
	arr := make([]T, le)
	for i := range le {
		arr[i] = T(rand.Float64() * float64(max))
	}
	return arr
}

var ArrInt128 = RandArr[int](128, 128)
var ArrFloat128 = RandArr[float64](128, 1)
